 package com.dwl.dbtemplate.dbutils.handlers;
 
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;

import com.dwl.dbtemplate.dbutils.ResultSetHandler;
 /***
  * 返回List类型为主的抽象类 和AbstractKeyedHandler一样继承ResultSethandler
  * @author Administrator
  *
  * @param <T>
  */
 public abstract class AbstractListHandler<T> implements ResultSetHandler<List<T>> {

   public List<T> handle(ResultSet rs) throws SQLException {
     List rows = new ArrayList();
     while (rs.next()) {
       rows.add(handleRow(rs));
     }
     return rows;
   }
 
   protected abstract T handleRow(ResultSet paramResultSet)
     throws SQLException;
 }




